---
sidebar_position: 6
---

# Changelog

## 2.6.1 - 08/10/2025

### Bug Fixes and Improvements
- switch JSX.Element to React.ReactElement to support React 19 and 18 (#437)



## 2.6.0 - 14/03/2025

### Bug Fixes and Improvements
- If a tree environment renders without an item defined as focused in its `viewState` parameter, it will invoke the `onFocusItem`
  prop with the first item in the tree during its render. In the past, this was implicitly and silently set in the `viewState` prop,
  now this assignment is triggered explicitly with the handler call (#363)
- Fixed a bug where an additional invalid drop target would be available at the bottom-most location when dragging via keyboard interactions (#363)



## 2.5.0 - 11/03/2025

### Breaking Changes
- Changed default keybinding of `startProgrammaticDnd` to `Control + Shift + D` (from `Control + D`) since the old
  binding conflicted with the default browser behavior of bookmarking the current page. You can customize the
  value with the `keyboardBindings` prop.

### Bug Fixes and Improvements
- Improved keyboard-controlled drag and drop behavior to not show redundant drop target directly below opened folder item (#363)
- Fixed an issue where the `toggleSelectItem` (Ctrl + Space) hotkey could not be rebounded or disabled (#363)

### Other Changes
 - Added some documentation on the data structure required by a StaticDataProvider.



## 2.4.6 - 18/11/2024

### Bug Fixes and Improvements
- Don't show drag line when dragging outside of the tree container (#417)
- Fix a bug where items where dropped on the last valid position when dragging items on an invalid position and then dropping (#417)



## 2.4.5 - 05/08/2024

### Breaking Changes

### Features

### Bug Fixes and Improvements
- Fix problem with expandSubsequently resolving before expanding all items (#403)
- Improve behavior for cases where item containers have margin (#404)

### Other Changes



## 2.4.4 - 18/05/2024

### Features
- Introduce `disableArrowKeys` prop on tree environment to disable arrow-related hotkeys (#363)



## 2.4.3 - 30/04/2024

### Features
- RTL mode can be used on default renderers, see [docs for details](https://rct.lukasbach.com//docs/guides/accessibility#right-to-left-mode-rtl) (#369)
- Redirect focus to first item if focused item was dragged to hidden location (#362)

### Bug Fixes and Improvements
- Fixes an issue where not providing a submit button ref in a custom rename input renderer would prevent dismissing the input on blur (#368)
- Fixes an issue where dropping an item on its children was possible through keyboard-based dragging (#363)



## 2.4.2 - 04/04/2024


### Bug Fixes and Improvements
- Fixed an issue where sometimes the uncontrolled tree environment would throw undefined-access errors (#355)



## 2.4.1 - 27/03/2024

### Bug Fixes and Improvements
- Fixed a bug where items where sometimes inserted with inverted order. (#353)
  - The `onDrop` should be a bit faster in general, since some redundant calls to `dataProvider.onChangeItemChildren` have been removed. In the past, this was called twice per item, once for moving the item out of its old folder, and once for moving it into the target folder. Now, all insertion calls into the target folder are batched into one `dataProvider.onChangeItemChildren` call for all dragged items.



## 2.4.0 - 21/03/2024

### Features
* Make drop target depth in last-of-subtree locations dependent on x-coordinates of the mouse, allowing the user to
  drop in higher depths than the currently hovering item. This behavior is automatically used if renderDepthOffset
  on the renderers is set to a non-zero value. (#148)

❤️ This development of this release was supported and [sponsored](https://github.com/sponsors/lukasbach) by
[Modyfi](https://modyfi.com). Thank you for contributing to the development of this library!



## 2.3.7 - 15/03/2024

# Featureset revertion to the state of 2.3.6

I've noticed that I've accidentally been pushing a few experimental releases that were meant to be released
as prerelease under the "Latest" tag in NPM. This reverts the latest release to the state of 2.3.6, the last
proper "latest" release. Prereleases will from now on be released under the "prerelease" tag in NPM.



## 2.3.6 - 07/03/2024

### Other Changes
- Add funding link to package.json



## 2.3.5 - 02/03/2024

### Features

- Add `setDomFocus` argument to focus-item methods to provide an escape hatch to set the focus state of an item in RCT
  without updating the DOM focus. This defaults to true in all existing methods to maintain the current behavior if
  it is absent. (#336)
- Allow customizing when a subtree is rendered or not with the new `shouldRenderChildren` prop. This can be used to 
  create opening and closing animations on subtrees. See [Demo](https://rct.lukasbach.com/storybook/?path=/story/core-basic-examples--animated-expanding-and-collapsing)
  and [Demo Implementation](https://github.com/lukasbach/react-complex-tree/blob/main/packages/core/src/stories/BasicExamples.stories.tsx#L561) for details. (#333)

### Bug Fixes

- Fix a bug where the `parentId` property in the `renderItemsContainer` render method was incorrectly set to the tree id
  for the root container.



## 2.3.4 - 18/01/2024

### Other Changes
- Make the `onDidChangeTreeDataEmitter` prop on a static data provider public



## 2.3.3 - 18/01/2024

### Bug Fixes and Improvements
- Maintain original item order when dropping items (#315)
- Expose some hooks and internally used components in the public API that were hidden before (#313)



## 2.3.2 - 05/12/2023

### Bug Fixes and Improvements
- Improved the implementation of the `onSelectItems` prop to not run during a React update, which was causing issues
  in some cases (#278)



## 2.3.1 - 04/12/2023

### Bug Fixes
- Items dropped at the bottom most position (outside of the rectangle of tree items, but still inside the tree container)
  will now be placed in the root item, at the final position, instead of the contents of the last open item (#261)



## 2.3.0 - 30/11/2023

### Breaking Changes
- Changed the behavior for dropping an item at the bottom of an open folder has changed, and will now drop
  into the open folder at its top, instead of the parent folder below the open folder. See discussion at #148 for details.
  You can opt out of this behavior by setting the `canDropBelowOpenFolders` prop on the tree environment (#148).

### Bug Fixes
- Fixed a bug where the `canRename` property in a tree item payload was not respected.



## 2.2.4 - 27/11/2023

### Features
- Add a `expandSubsequently` method on the environment and tree refs, to facilitate searching through items that are not yet opened (#287). See https://rct.lukasbach.com/docs/guides/search#finding-items-that-are-not-loaded-in for details



## 2.2.3 - 24/10/2023


### Bug Fixes and Improvements
- Fix Syntax Error in CSS styles (#288)



## 2.2.2 - 31/07/2023

### Features
- Introduce `disableMultiselect` property on uncontrolled tree environment (#279)

### Bug Fixes and Improvements
- Fixes a bug where a state property is updated when the component is unmounted (#278)



## 2.2.1 - 22/07/2023

<!--
### Breaking Changes

### Features

### Bug Fixes and Improvements

### Other Changes
-->



## 2.2.0 - 14/06/2023

### Features
- Added `stopRenamingItem()` function to item render context (#271)

### Bug Fixes and Improvements
- Added check in `onMissingItems` in case `dataProvider.getTreeItems` return null as tree value (#272)
- Remove unused types `renderDraggingItem` and `renderDraggingItemTitle`
- Don't use timeout to update linear items (#266)



## 2.1.5-alpha.0 - 20/05/2023

<!--
### Breaking Changes

### Features

### Bug Fixes and Improvements

### Other Changes
-->



## 2.1.4 - 16/05/2023

<!--
### Breaking Changes

### Features

### Bug Fixes and Improvements

### Other Changes
-->



## 2.1.4-alpha.0 - 02/05/2023

### Bug Fixes and Improvements
- Fixed globally-scoped references to the document prop into a getter that doesn't fail in ssr environments (#259)



## 2.1.3 - 02/05/2023

### Bug Fixes and Improvements
- Fixed a bug where dragging to an item and back to the original position would still drop the item on the temporary position (#249)



## 2.1.2 - 02/04/2023

### Bug Fixes and Improvements

* Fixed a bug where the icon was misaligned when scrolling in the modern theme (#239)



## 2.1.1 - 27/02/2023

### Bug Fixes and Improvements

* Fixes bug where dropping an item on its own descendant makes it vanish (#227)



## 2.1.0 - 24/02/2023

### Bug Fixes and Improvements

* Dragging on a non-folder item with `canDropOnNonFolder=false` and
  `canReorderItems=false` will now target the item's parent. (#219)



## 2.0.4 - 05/02/2023

### Bug Fixes and Improvements

* Fix: Previous release did not include the new css file.



## 2.0.3 02/04/2023

### Features
* Introduced new tree theme. You can opt into the new theme by importing `style-modern.css` instead of `style.css`

### Other Changes
* Fixed broken props-tables documentations for react components.
* Fixed incomplete getstarted documentation page.

## 2.0.2 12/31/2022

### Bug Fixes and Improvements

* Fixed a bug where dragging a node above the topmost node throws an error in the log (#203)
* Fixed a bug where dragging an item onto itself would make it disappear from the tree (#205)

## 2.0.1 12/18/2022

### Bug Fixes and Improvements
* Fixed a bug where autofocus for the search input was not working for blueprintjs renderers (#197)
* Fixed a bug where tree labels where not set (#195)
* Reduce react peer dependency requirement to v16 (#196)

### Other Changes
* Upgraded storybook and yarn dependencies in dev tooling
* Added release pipeline in CI

## 2.0.0 - 12/05/2022

### Breaking Changes
- Replaced `item.hasChildren` property with `item.isFolder`
- Replaced `environment.canDropOnItemWithChildren` property with `environment.canDropOnFolder`
- Replaced `environment.canDropOnItemWithoutChildren` property with `environment.canDropOnNonFolder`
- Replaced CSS classes related to `hasChildren` with `isFolder`, e.g. `rct-tree-item-li-hasChildren` to `rct-tree-item-li-isFolder`

Note: These properties were just renamed, but the functionality is the same. `hasChildren` has
always denoted whether an item is a folder or not, which confused a lot of people and was admittedly
very bad naming. The new name is a better reflection of its functionality. The other two properties
were renamed alongside to match.

### Bug Fixes and Improvements

- Upgraded library to React 18.
- Improved how "select up to" (i.e. shift+clicking) works, to match how users would expect it to work. The user can
  now create multiple distinct selection ranges by clicking and shift-clicking another item, then control clicking
  a different item and shift+control clicking a forth item.
- The function `treeItemActions.selectUpTo()` now accepts an optional boolean argument determining whether
  the previous selection range should be cleared before selecting the new range.
- Removed unnecessary memoization for event handlers, favoring stable callbacks stored in refs instead.
- Fixed a bug where renaming an item would make the page loose focus of the active tree.
- Items can now be dropped on empty trees. The tree container will need to be rendered with a minimum height for this
  to work, in the default renderers the container will now render with a minimum height of 30px, which can be adjusted
  in custom renderers.
- Fixed a bug where renaming from item renderer context was not working.

### Other Changes

- Added linter rules from airbnb config and fixed relevant issues. This fixed some memoization imperfections, which
  should improve performance.
- (Finally) added integration tests. This will ease the future development and help reduce regressions.

### Migration guide
- Replace the `hasChildren` property for tree items with `isFolder`.
- Replace the `canDropOnItemWithChildren` property on tree environment components or tree components with `canDropOnFolder`.
- Replace the `canDropOnItemWithoutChildren` property on tree environment components or tree components with `canDropOnNonFolder`.
- The upgrade of React to 18 should not require any changes on your end.
- If you are using custom interaction managers and want to benefit from the improved "select up to" functionality,
  replace `actions.selectUpTo()` with `actions.selectUpTo(!e.ctrlKey)` in the `onClick` handler.
- If you are overwriting CSS styles for rct-specific classes, replace `hasChildren` with `isFolder` in the class names.
